package com.itheima.泛型.sort.Comparable;

import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;

/**
 * @Author 王加鑫
 * @Date 2021/5/14 12:45
 * @Version 1.0
 */
public class PersonTest {
    public static void main(String[] args) {
        Set<Person> set = new TreeSet<>();
        Person person1 = new Person("zhangsan",25);
        Person person2 = new Person("lisi",23);
        Person person3 = new Person("wangwu",18);
        Person person4 = new Person("zhangsi",25);
//        Person person5 = new Person("花小花",25);

        Collections.addAll(set,person1,person2,person3,person4);
        System.out.println(set);
    }
}
